let app = getApp();
Page({
  data: {
    list: [],
    numPerPage: 9999,
    pageNum: 1,
    userId: null
  },
  onLoad() {
    app.checkLogin().then((res) => {
      this.setData({
        userId: res.user.id
      });
      this.QueryAccountCash();
    });
  },
  QueryAccountCash() {
    let upData = {
      "numPerPage": this.data.numPerPage,
      "order": "asc",
      "pageNum": 1,
      "userId": this.data.userId
    };
    app.post("queryAccountCash", upData).then((res) => {
      this.setData({
        list: res.data.rows.map(item => {
          item.bankCardNumber = item.bankCardNumber.replace(/(\S{4})\w+(\S{4})$/, "$1****$2")
          return item;
        })
      })
    })
  }
})